ZF.add('node', function(Z) {

    var D = Z.Dom,
        L = Z.Lang,
        typeName = '_zfNode';

    var N = Z.Node = Z.create({

        construct : function(tag, node, attr) {
            var self = this;
            
            if (L.isString(tag)) {
                self._dom = D.create(tag, node, attr);
            } else if (tag instanceof N) {
                return tag;
            } else {
                self._dom = tag;
            }

            return self;
        },
        
        getDom : function() {
            return this._dom;
        },
        
        type : typeName

    }, null, { type : typeName });

    Z.extend(D, {

        one : function(selector, context) {
            var el = D.get(selector, context);
            return el ? new N(el) : null;
        }

    });

}, { requires : ['dom', 'dom-query'] });
